gtk4.git
11 years agoUpdated Greek translations
Tom Tryfonidis [Mon, 23 Mar 2015 09:59:24 +0000 (11:59 +0200)]
Updated Greek translations

11 years agoUpdated Italian translation
Milo Casagrande [Mon, 23 Mar 2015 07:29:55 +0000 (07:29 +0000)]
Updated Italian translation

11 years agoUpdated Italian translation
Milo Casagrande [Mon, 23 Mar 2015 07:25:57 +0000 (07:25 +0000)]
Updated Italian translation

11 years agoStop using GDK_POINTER_MOTION_HINT_MASK in widgets
Matthias Clasen [Sun, 22 Mar 2015 04:49:16 +0000 (00:49 -0400)]
Stop using GDK_POINTER_MOTION_HINT_MASK in widgets

It is deprecated and no longer needed, and,as observed in
https://bugzilla.gnome.org/show_bug.cgi?id=746253 it
interferes with turning off event compression.

11 years agoSilence another compiler warning
Matthias Clasen [Sun, 22 Mar 2015 19:20:43 +0000 (15:20 -0400)]
Silence another compiler warning

Again, our habit of comparing enum values against -1.

11 years agoDon't return G_TYPE_INVALID as a pointer
Matthias Clasen [Sun, 22 Mar 2015 19:19:59 +0000 (15:19 -0400)]
Don't return G_TYPE_INVALID as a pointer

Use NULL for g_return_val_if_fail checks if the function returns
a pointer. Pointed out by clang.

11 years agotext view: Avoid clang compiler warnings
Matthias Clasen [Sun, 22 Mar 2015 19:19:17 +0000 (15:19 -0400)]
text view: Avoid clang compiler warnings

Again, our habit to use -1 as an unset value for enum types.

11 years agoRemove a redundant const
Matthias Clasen [Sun, 22 Mar 2015 19:18:35 +0000 (15:18 -0400)]
Remove a redundant const

const gchar const is still just const gchar, unless there's
indirections in between.

11 years agocss: Silence a clang warning
Matthias Clasen [Sun, 22 Mar 2015 19:17:27 +0000 (15:17 -0400)]
css: Silence a clang warning

Clang complains that this check can never be true. Since this
is a argument range check which we do to catch bad input,
convince clang to not complain instead of taking it out.

11 years agoRemove a pointless comparison
Matthias Clasen [Sun, 22 Mar 2015 19:16:14 +0000 (15:16 -0400)]
Remove a pointless comparison

Comparing an unsigned value against < 0 is not going to succeed.
Pointed out by clang.

11 years agopaper size: Don't use abs() on floats
Matthias Clasen [Sun, 22 Mar 2015 19:15:42 +0000 (15:15 -0400)]
paper size: Don't use abs() on floats

Use fabs() instead. Pointed out by clang.

11 years agoMore of the same
Matthias Clasen [Sun, 22 Mar 2015 19:14:42 +0000 (15:14 -0400)]
More of the same

A similar case in GtkIconHelper. Here we were confusing ourselves,
and compared a icon_size against -1, although the variable is
never set to -1.

11 years agoAvoid some clang compiler warnings
Matthias Clasen [Sun, 22 Mar 2015 19:12:30 +0000 (15:12 -0400)]
Avoid some clang compiler warnings

Avoid some compiler warnings from clang in deprecated code.
Most of these are around our habit of using -1 as an 'unset'
value for enumerations.

11 years agoFix some clang warnings
Matthias Clasen [Sun, 22 Mar 2015 18:40:57 +0000 (14:40 -0400)]
Fix some clang warnings

It complains about double const, and it is right.

11 years agoMake the blur code compile with clang
Matthias Clasen [Sun, 22 Mar 2015 17:48:02 +0000 (13:48 -0400)]
Make the blur code compile with clang

clang complains that the expression involving sqrt() is not
constant, and thus refuses to accept it as a case label. So,
use precomputed values instead.

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agoFix the build
Matthias Clasen [Sun, 22 Mar 2015 15:55:33 +0000 (11:55 -0400)]
Fix the build

11 years agotooltip: Minor cleanup
Matthias Clasen [Sun, 22 Mar 2015 15:47:23 +0000 (11:47 -0400)]
tooltip: Minor cleanup

Preserve the symmetry in gtk_tooltip_set_last_window.

11 years agosearch bar: Clean up weak pointer handling
Matthias Clasen [Sun, 22 Mar 2015 15:46:16 +0000 (11:46 -0400)]
search bar: Clean up weak pointer handling

Break out a setter that manages the weak pointer, and
use it in finalize. This also fixes a bug where we were
forgetting to disconnect the right signal handler in
some cases.

11 years agomount operation: Minor formatting cleanup
Matthias Clasen [Sun, 22 Mar 2015 15:45:19 +0000 (11:45 -0400)]
mount operation: Minor formatting cleanup

The pattern for g_object_add_weak_pointer calls is to
have the same expression in both arguments.

11 years agomenu button: Minor cleanup
Matthias Clasen [Sun, 22 Mar 2015 15:44:37 +0000 (11:44 -0400)]
menu button: Minor cleanup

Preserve the symmetry in set_align_widget_pointer.

11 years agoClean up some unfortunate formatting
Matthias Clasen [Sun, 22 Mar 2015 15:44:00 +0000 (11:44 -0400)]
Clean up some unfortunate formatting

"if (...) do" just looks wrong.

11 years agodnd: Introduce a helper to manage the weak pointer
Matthias Clasen [Sun, 22 Mar 2015 15:13:08 +0000 (11:13 -0400)]
dnd: Introduce a helper to manage the weak pointer

Introduce a setter that takes care of updating the weak ref
whenever we assign info->widget. Just a cleanup of the previous patch.

11 years agoDND: Clean up weak pointers when they are no longer needed
Tom Hughes [Sun, 22 Mar 2015 10:55:00 +0000 (10:55 +0000)]
DND: Clean up weak pointers when they are no longer needed

Failure to do so leads to memory corruption down the road.
This was introduced in commit 650c25e06c17.

https://bugzilla.gnome.org/show_bug.cgi?id=746602

11 years agoUpdated German translation
Christian Kirbach [Sun, 22 Mar 2015 11:07:20 +0000 (11:07 +0000)]
Updated German translation

11 years agoUpload Catalan translation
Jordi Mas [Sun, 22 Mar 2015 08:18:27 +0000 (04:18 -0400)]
Upload Catalan translation

11 years agoAdd an index for new api to the docs
Matthias Clasen [Sun, 22 Mar 2015 06:11:03 +0000 (02:11 -0400)]
Add an index for new api to the docs

11 years agoradio-menu-item: Add join_group()
Matthias Clasen [Sun, 22 Mar 2015 05:57:57 +0000 (01:57 -0400)]
radio-menu-item: Add join_group()

The other Radio* widgets have this convenience method that removes the
memory management of the opaque GSList used to handle the group from the
API usable from language bindings (especially the ones not based on
introspection).

This commit adds gtk_radio_menu_item_join_group().

https://bugzilla.gnome.org/show_bug.cgi?id=671362

11 years agoradio-menu-item: Allow arguments to be NULL
Matthias Clasen [Sun, 22 Mar 2015 05:54:08 +0000 (01:54 -0400)]
radio-menu-item: Allow arguments to be NULL

Some arguments, like the group and the label of a RadioMenuItem, can be
NULL: the RadioMenuItem has all the code to deal with them. The argument
validation is too strict, though, for instance doing:

  return_if_fail (IS_RADIO_MENU_ITEM (foo))

  if (foo != NULL)
    set_foo (foo)

Which is obviously incorrect.

This commit also modifies the annotations of the API, to ensure that
language bindings do the right thing.

https://bugzilla.gnome.org/show_bug.cgi?id=671362

11 years agoradio-menu-item: Handle a !NULL group
Emmanuele Bassi [Mon, 5 Mar 2012 13:09:47 +0000 (13:09 +0000)]
radio-menu-item: Handle a !NULL group

If we create a RadioMenuItem without a group, and then set a group, the
menu item will still be set as active, which means an inconsistently
drawn radio menu item - as the RadioMenuItem will set the active flag on
itself, but then it won't reset it when it gets a new group.

https://bugzilla.gnome.org/show_bug.cgi?id=671362

11 years agoStart 3.17 development
Matthias Clasen [Sun, 22 Mar 2015 06:00:04 +0000 (02:00 -0400)]
Start 3.17 development

Bump the version to 3.17.0 and add version macros.

11 years agoImprove CSD decorations without a compositor
Olivier Fourdan [Wed, 11 Mar 2015 12:52:21 +0000 (13:52 +0100)]
Improve CSD decorations without a compositor

It turned out that using mwm hints to instruct wms to
create border-only decorations is not really working
universally. So, instead of doing this, render a solid
frame without shadow on the client-side to handle this
case.

https://bugzilla.gnome.org/show_bug.cgi?id=746222

Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
11 years agoimage: Optimize non-resize changes
Matthias Clasen [Sat, 31 Jan 2015 04:32:50 +0000 (23:32 -0500)]
image: Optimize non-resize changes

When the image content is changed, only queue a resize
if the size is actually changing, otherwise just a
redraw. Suggested by Owen in

https://bugzilla.gnome.org/show_bug.cgi?id=613833

11 years agoa11y: handle atk race condition where widget has been destroyed
Christian Hergert [Sat, 21 Mar 2015 21:17:39 +0000 (14:17 -0700)]
a11y: handle atk race condition where widget has been destroyed

If the widget has been destroyed since a DBus message had been sent,
we could be in a condition that the widget pointer exists but it does
not have a window.

This bails as if the widget didn't exist if there is no available
GdkWindow.

We also set the extents to 0 to be defensive since this is a vfunc
implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=746586

11 years agoUpdated Turkish translation
Muhammet Kara [Sat, 21 Mar 2015 21:25:38 +0000 (21:25 +0000)]
Updated Turkish translation

11 years agobox-shadow: For top/bottom and left/right parts, repeat a single line
Alexander Larsson [Fri, 20 Mar 2015 13:56:42 +0000 (14:56 +0100)]
box-shadow: For top/bottom and left/right parts, repeat a single line

Since these part really are the same in all of the x or y direction
and we don't blur in that direction we can just blur one line and
repeat it during drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agoshadow-box: Blur only horizontally/vertically for the non-corner parts
Alexander Larsson [Fri, 20 Mar 2015 13:34:44 +0000 (14:34 +0100)]
shadow-box: Blur only horizontally/vertically for the non-corner parts

There is no need to e.g. blur in the x-direction for the top part
of a box shadow. Also, there is no need to extend the mask in the
non-blurred direction.

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agoshadow-box: Bail out blur early if radius is 1px
Alexander Larsson [Fri, 20 Mar 2015 13:31:57 +0000 (14:31 +0100)]
shadow-box: Bail out blur early if radius is 1px

For radius 1px the current implementation rounds down to a 1 px box
filter which is a no-op. Rather than creating useless shadow masks
in this case we bail out blurring early.

Another alternative would be to make radius 1px round up to a 2 px box
filter, but that would change the rendering of Adwaita which is probably
not a great idea this late in the cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agogtkcairoblur: Unroll inner loop for common radius values
Alexander Larsson [Thu, 19 Mar 2015 15:29:32 +0000 (16:29 +0100)]
gtkcairoblur: Unroll inner loop for common radius values

This unrolls the inner blur loop for radius 1-10, allowing
the compiler to use a divide-by-constant operation instead
of a generic division.

Here is the blur-performance output before:

Radius  1: 124.95 msec, 32.01 kpixels/msec:
Radius  2: 117.27 msec, 34.11 kpixels/msec:
Radius  3: 123.57 msec, 32.37 kpixels/msec:
Radius  4: 118.17 msec, 33.85 kpixels/msec:
Radius  5: 119.32 msec, 33.52 kpixels/msec:
Radius  6: 124.17 msec, 32.21 kpixels/msec:
Radius  7: 121.04 msec, 33.05 kpixels/msec:
Radius  8: 130.64 msec, 30.62 kpixels/msec:
Radius  9: 119.47 msec, 33.48 kpixels/msec:
Radius 10: 117.95 msec, 33.91 kpixels/msec:
Radius 11: 122.38 msec, 32.68 kpixels/msec:
Radius 12: 121.92 msec, 32.81 kpixels/msec:
Radius 13: 125.45 msec, 31.89 kpixels/msec:
Radius 14: 121.63 msec, 32.89 kpixels/msec:
Radius 15: 120.18 msec, 33.28 kpixels/msec:

And after:

Radius  1: 42.26 msec, 94.65 kpixels/msec:
Radius  2: 59.15 msec, 67.62 kpixels/msec:
Radius  3: 60.29 msec, 66.35 kpixels/msec:
Radius  4: 64.53 msec, 61.99 kpixels/msec:
Radius  5: 60.07 msec, 66.59 kpixels/msec:
Radius  6: 62.43 msec, 64.07 kpixels/msec:
Radius  7: 60.36 msec, 66.27 kpixels/msec:
Radius  8: 59.59 msec, 67.13 kpixels/msec:
Radius  9: 76.17 msec, 52.51 kpixels/msec:
Radius 10: 79.41 msec, 50.37 kpixels/msec:
Radius 11: 118.92 msec, 33.64 kpixels/msec:
Radius 12: 121.31 msec, 32.97 kpixels/msec:
Radius 13: 118.30 msec, 33.81 kpixels/msec:
Radius 14: 116.82 msec, 34.24 kpixels/msec:
Radius 15: 116.99 msec, 34.19 kpixels/msec:

I.e. almost double performance for the unrolled radius values.

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agogtkcairoblur: Minor restructure
Alexander Larsson [Thu, 19 Mar 2015 15:25:25 +0000 (16:25 +0100)]
gtkcairoblur: Minor restructure

This just moves get_box_filter_size to the top and makes
it a macro (so it can be used as a constant later).

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agoAdd performance test for gtkcairoblur
Alexander Larsson [Thu, 19 Mar 2015 15:24:19 +0000 (16:24 +0100)]
Add performance test for gtkcairoblur

This just creates a large cairo surface and times bluring it
at various values of radius.

https://bugzilla.gnome.org/show_bug.cgi?id=746468

11 years agoUpdated Dutch translation gtk and gtk-properties master 3.16
hanniedu [Sat, 21 Mar 2015 17:25:17 +0000 (18:25 +0100)]
Updated Dutch translation gtk and gtk-properties master 3.16

11 years agoHighContrast: Fix a typo
Matthias Clasen [Sat, 21 Mar 2015 00:48:25 +0000 (20:48 -0400)]
HighContrast: Fix a typo

Commit 0a39d7d9 introduced a selected_bg_color with a missing $
in front of it.

11 years agoUpdated Hungarian translation
Gábor Kelemen [Fri, 20 Mar 2015 23:23:24 +0000 (23:23 +0000)]
Updated Hungarian translation

11 years agoUpdated Hungarian translation
Balázs Úr [Fri, 20 Mar 2015 22:57:03 +0000 (22:57 +0000)]
Updated Hungarian translation

11 years agoreftests: Add a way to compare different runs
Matthias Clasen [Fri, 20 Mar 2015 20:39:36 +0000 (16:39 -0400)]
reftests: Add a way to compare different runs

gtk-reftest already had an --output=DIR option to tell it where
to save all the resulting images. Now you can combine this with
the --compare-with=DIR option in a second run to make gtk-reftest
compare the .out.png files from the first run with the .out.png
files of the current run, instead of producing .ref.png files.

The intended use for this is to verify that changes do not affect
the generated output.

11 years agomir: Fix version annotation, the mir-backend is available since 3.16
Rico Tzschichholz [Fri, 20 Mar 2015 19:18:44 +0000 (20:18 +0100)]
mir: Fix version annotation, the mir-backend is available since 3.16

11 years agofix insensitive and backdrop states
Jakub Steiner [Fri, 20 Mar 2015 12:22:47 +0000 (13:22 +0100)]
fix insensitive and backdrop states

- checkboxes, labels and buttons were a mixed bag for
  :insensitive and :backdrop

https://bugzilla.gnome.org/show_bug.cgi?id=746188

11 years agoHighContrast: fix insensitive labels
Matthias Clasen [Fri, 20 Mar 2015 10:20:30 +0000 (06:20 -0400)]
HighContrast: fix insensitive labels

Make insensitive labels differerent from regular labels.

https://bugzilla.gnome.org/show_bug.cgi?id=746493

11 years agogtk-demo: Plug a memory leak
Matthias Clasen [Fri, 20 Mar 2015 02:57:10 +0000 (22:57 -0400)]
gtk-demo: Plug a memory leak

11 years agowidget-factory: Fix toolbar on page 3
Matthias Clasen [Thu, 19 Mar 2015 23:11:39 +0000 (19:11 -0400)]
widget-factory: Fix toolbar on page 3

Set toolbar-style to 'icons' to avoid rectangular buttons.

11 years agoUpdated Norwegian bokmål translation.
Kjartan Maraas [Thu, 19 Mar 2015 20:13:10 +0000 (21:13 +0100)]
Updated Norwegian bokmÃ¥l translation.

11 years agoinspector: show accessible name and description
Vadim Rutkovsky [Thu, 19 Mar 2015 11:00:01 +0000 (12:00 +0100)]
inspector: show accessible name and description

11 years agowayland: Silence warnings on clipboard data sending cancellation
Carlos Garnacho [Thu, 19 Mar 2015 14:58:00 +0000 (15:58 +0100)]
wayland: Silence warnings on clipboard data sending cancellation

During copy/paste, it may be common that we receive several property changes
around the selection atom, this results in warnings when cancelling the previous
write attempt. We already honor the last request properly, so we should just
cancel silently.

11 years agowayland: Ensure we re-request the target if the fd changes
Carlos Garnacho [Thu, 19 Mar 2015 14:54:48 +0000 (15:54 +0100)]
wayland: Ensure we re-request the target if the fd changes

If we receive wl_data_source.target before .send, the target would already
be cached, but we'd take no action on the new fd.

11 years agowayland: Don't accept the "TARGETS" target on the wl_data_offer
Carlos Garnacho [Thu, 19 Mar 2015 14:49:04 +0000 (15:49 +0100)]
wayland: Don't accept the "TARGETS" target on the wl_data_offer

This is handled separately through the data already cached from the
wl_data_offer.offer handler, we can avoid this request entirely then.

11 years agoUpdated Serbian translation
Милош Поповић [Thu, 19 Mar 2015 13:20:12 +0000 (13:20 +0000)]
Updated Serbian translation

11 years agoAdwaita: Fix context menu shadows not showing up
Benjamin Otte [Thu, 19 Mar 2015 02:54:38 +0000 (03:54 +0100)]
Adwaita: Fix context menu shadows not showing up

11 years agoinspector: Make it easier to cut'n'paste advice message
Bastien Nocera [Wed, 18 Mar 2015 10:44:40 +0000 (11:44 +0100)]
inspector: Make it easier to cut'n'paste advice message

The message says "Enable statistics with GOBJECT_DEBUG=instance-count"
but the message itself isn't selectable, making it hard to cut'n'paste.

https://bugzilla.gnome.org/show_bug.cgi?id=746391

11 years agocsspathnode: Handle context going away
Benjamin Otte [Wed, 18 Mar 2015 17:22:17 +0000 (18:22 +0100)]
csspathnode: Handle context going away

Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.

Fixes startup of mutter.

Testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=746407

11 years agoinspector: Add a new page that lists the CSS node tree
Benjamin Otte [Mon, 2 Mar 2015 23:02:25 +0000 (00:02 +0100)]
inspector: Add a new page that lists the CSS node tree

11 years agocssnode: Add properties
Benjamin Otte [Thu, 5 Mar 2015 19:29:37 +0000 (20:29 +0100)]
cssnode: Add properties

11 years agocsswidgetnode: Use style_changed signal instead of update_style vfunc
Benjamin Otte [Thu, 5 Mar 2015 16:51:23 +0000 (17:51 +0100)]
csswidgetnode: Use style_changed signal instead of update_style vfunc

11 years agocssnode: Add a style-changed signal
Benjamin Otte [Thu, 5 Mar 2015 16:35:57 +0000 (17:35 +0100)]
cssnode: Add a style-changed signal

The signal gets emitted whenever the style needs to be changed.

11 years agocssnode: Add node-added and node-removed signal
Benjamin Otte [Sun, 1 Mar 2015 20:33:54 +0000 (21:33 +0100)]
cssnode: Add node-added and node-removed signal

This allows monitoring the CSS tree. For now, moving a child to a
different position relative to its siblings while keeping the same
parent will cause a child-added + child-removed emission.

11 years agocssnode: Track invalid children
Benjamin Otte [Sun, 1 Mar 2015 12:14:01 +0000 (13:14 +0100)]
cssnode: Track invalid children

We need to properly track if a node needs to propagate invalidation
state information to its children. We didn't do this properly before and
that could lead to us forgetting to invalidate nodes in corner cases.

11 years agocsswidgetnode: Avoid creating a stylecontext
Benjamin Otte [Thu, 5 Mar 2015 05:23:35 +0000 (06:23 +0100)]
csswidgetnode: Avoid creating a stylecontext

If the widget doesn't have a style context, don't create one. Instead,
call functions on the widget directly.

11 years agocssnode: Change the way we invalidate timestamps
Benjamin Otte [Sat, 28 Feb 2015 01:22:38 +0000 (02:22 +0100)]
cssnode: Change the way we invalidate timestamps

Do not propagate the TIMESTAMP change through the node tree, as that
causes lots of uneeded markings of nodes as invalid.

Instead, walk the node tree and find the nodes that have a non-static
style and only invalidate timestamps on those.

11 years agocssstyle: Add gtk_css_style_is_static()
Benjamin Otte [Fri, 27 Feb 2015 17:41:13 +0000 (18:41 +0100)]
cssstyle: Add gtk_css_style_is_static()

Gets rid of the need to do

  if (ANIMATED_STYLE() &&
      animated_style_is_static(ANIMATED_STYLE(style))

11 years agocssnode: Special-case TIMESTAMP invalidations
Benjamin Otte [Wed, 25 Feb 2015 17:25:01 +0000 (18:25 +0100)]
cssnode: Special-case TIMESTAMP invalidations

Only invalidate timestamps if the node is marked as invalid. We overload
the meaning of "invalid" as "tracks timestamps".

While I don't like the way this is written, it is an important
optimization because 95+% of nodes don't animate so timestamps don't
matter to them. But timestamps are invalidated 60x per second.

11 years agocssnode: Redo style changed tracking
Benjamin Otte [Wed, 25 Feb 2015 17:05:07 +0000 (18:05 +0100)]
cssnode: Redo style changed tracking

We don't return a NULL style to mean "no changes" anymore, instead
we check new_style == old_style to mean that.

Make sure the code reflects this, otherwise we'll send
GTK_CSS_CHANGE_PARENT_STYLE invalidations everywhere and screw up
performance.

11 years agostylecontext: Call get_style(), not create_style()
Benjamin Otte [Mon, 23 Feb 2015 02:06:02 +0000 (03:06 +0100)]
stylecontext: Call get_style(), not create_style()

We want to ensure that the style is created properly.

This also allows making the create_Style() function private.

11 years agocssnode: Merge the 2 places that compute styles
Benjamin Otte [Sun, 22 Feb 2015 22:28:04 +0000 (23:28 +0100)]
cssnode: Merge the 2 places that compute styles

Now that the widget node recomputes styles on update_style() we can just
call it during validate(). That way, we don't need the widget node to
manually compute its style.

11 years agocssnode: Always return correct style values
Benjamin Otte [Sun, 22 Feb 2015 22:11:22 +0000 (23:11 +0100)]
cssnode: Always return correct style values

If CSS values are queried from a widget, recompute them if necessary. Do
not emit style-updated until the validation phase however.

This way, we don't run into performance traps when style-update causes
invalidations that cause new style-updated to be emitted.

11 years agocssstyle: Add optimization
Benjamin Otte [Sun, 22 Feb 2015 17:04:43 +0000 (18:04 +0100)]
cssstyle: Add optimization

There is no difference between a style and itself.

11 years agostylecontext: Refactor gtk_style_context_invalidate()
Benjamin Otte [Sun, 22 Feb 2015 07:26:29 +0000 (08:26 +0100)]
stylecontext: Refactor gtk_style_context_invalidate()

There's no need anymore to recreate styles, nodes do that automagically
now.

This allows making gtk_css_node_set_style() private.

11 years agocssnode: Create animated styles by default
Benjamin Otte [Sun, 22 Feb 2015 07:23:04 +0000 (08:23 +0100)]
cssnode: Create animated styles by default

... and hardcode transient and path nodes to never create animated
styles.

11 years agocssnode: Add optimization
Benjamin Otte [Sun, 22 Feb 2015 05:19:33 +0000 (06:19 +0100)]
cssnode: Add optimization

Don't even try to propagate changes when we know there are none.

11 years agocssnode: Change the way we start animations
Benjamin Otte [Sat, 21 Feb 2015 02:40:46 +0000 (03:40 +0100)]
cssnode: Change the way we start animations

We now have a flag for "invalidate animations", use that to restart
animations and decide if we want to start transitions.

11 years agocssnode: Return NULL as frame clock when animations are disabled
Benjamin Otte [Fri, 20 Feb 2015 23:16:58 +0000 (00:16 +0100)]
cssnode: Return NULL as frame clock when animations are disabled

This is a crude hack, but it works.

FIXME: Hook it up to the GtkSettings so that we properly update when the
setting changes.

11 years agocssstyle: Handle 0 timestamp to mean "don't animate"
Benjamin Otte [Fri, 20 Feb 2015 23:15:04 +0000 (00:15 +0100)]
cssstyle: Handle 0 timestamp to mean "don't animate"

11 years agocssnode: Move style context function to only user
Benjamin Otte [Fri, 20 Feb 2015 16:36:10 +0000 (17:36 +0100)]
cssnode: Move style context function to only user

11 years agocssnode: Remove timestamp from gtk_css_node_validate()
Benjamin Otte [Fri, 20 Feb 2015 16:28:23 +0000 (17:28 +0100)]
cssnode: Remove timestamp from gtk_css_node_validate()

GtkCssNode knows its own timestamp.

11 years agocssnode: Add API to query the timestamp
Benjamin Otte [Wed, 18 Feb 2015 23:54:14 +0000 (00:54 +0100)]
cssnode: Add API to query the timestamp

... and pass it to the API that computes new styles.

A special timestamp of 0 means "please don't animate" and is used when
no frame clock is available for a node.

11 years agocssnode: Make parent style change part of GtkCssNode
Benjamin Otte [Wed, 18 Feb 2015 05:01:41 +0000 (06:01 +0100)]
cssnode: Make parent style change part of GtkCssNode

11 years agocssnode: Propagate pending changes after recomputing new style
Benjamin Otte [Wed, 18 Feb 2015 04:55:38 +0000 (05:55 +0100)]
cssnode: Propagate pending changes after recomputing new style

This way we can propagate if the new style actually changed anything.

11 years agocssnode: Add gtk_css_node_invalidate_style_provider()
Benjamin Otte [Tue, 17 Feb 2015 15:11:38 +0000 (16:11 +0100)]
cssnode: Add gtk_css_node_invalidate_style_provider()

This function not just invalidates the current node, but also all
children.

11 years agocssnode: Change get_style_provider() vfunc
Benjamin Otte [Tue, 17 Feb 2015 14:18:32 +0000 (15:18 +0100)]
cssnode: Change get_style_provider() vfunc

Instead of always returning a provider, allow the vfunc to return NULL
to mane "use same provider as parent". This allows a bunch of
optimizations.

11 years agocssnode: Implement a way to properly track invalidations
Benjamin Otte [Tue, 17 Feb 2015 04:01:09 +0000 (05:01 +0100)]
cssnode: Implement a way to properly track invalidations

See the comment in gtkcssnodeprivate.h for how this works.

11 years agocssnode: Change vfunc
Benjamin Otte [Sat, 14 Feb 2015 05:45:21 +0000 (06:45 +0100)]
cssnode: Change vfunc

This is mainly an attempt to merge the update_style() and validte()
vfuncs. Code is not there yet, but that's the idea.

Also, gtk_css_node_set_style() should not be public. And this gets
closer to that goal, too.

11 years agocssnode: Only pass a boolean for parent changes
Benjamin Otte [Sat, 14 Feb 2015 05:40:00 +0000 (06:40 +0100)]
cssnode: Only pass a boolean for parent changes

Nobody cares what changed in the parent, so don't track it.

11 years agocssvalue: Remove GtkCssDependencies
Benjamin Otte [Sat, 14 Feb 2015 01:27:39 +0000 (02:27 +0100)]
cssvalue: Remove GtkCssDependencies

They are not used anymore.

11 years agocssstyle: Remove unused optimization
Benjamin Otte [Sat, 14 Feb 2015 00:59:17 +0000 (01:59 +0100)]
cssstyle: Remove unused optimization

After measuring it, I realized the optimization never triggers for
Adwaita and rarely ever triggers for simple themes. So it is not
useful to keep it around.

11 years agocsswidgetnode: Always return a valid style
Benjamin Otte [Fri, 13 Feb 2015 21:04:26 +0000 (22:04 +0100)]
csswidgetnode: Always return a valid style

11 years agocsspathnode: Call gtk_style_context_validate()
Benjamin Otte [Fri, 13 Feb 2015 21:00:06 +0000 (22:00 +0100)]
csspathnode: Call gtk_style_context_validate()

Don't call gtk_style_context_invalidate(), that function does too much
work.

11 years agotestsuite: Add another random stylecontext test
Benjamin Otte [Fri, 13 Feb 2015 20:21:46 +0000 (21:21 +0100)]
testsuite: Add another random stylecontext test

11 years agocssnode: Use the frame clock's time
Benjamin Otte [Fri, 13 Feb 2015 18:57:55 +0000 (19:57 +0100)]
cssnode: Use the frame clock's time

... nstead of the monotonic time when validating a cssnode.

11 years agocssnode: Treat transient nodes as invisible nodes
Benjamin Otte [Fri, 13 Feb 2015 11:44:04 +0000 (12:44 +0100)]
cssnode: Treat transient nodes as invisible nodes

Making transient nodes invisible allows us to remove special cases
without any bad side effects and they continue working just like they
did before.

11 years agoreftests: Add a reftest for box sibling ordering
Benjamin Otte [Tue, 10 Feb 2015 01:53:28 +0000 (02:53 +0100)]
reftests: Add a reftest for box sibling ordering

11 years agocssnode: Add visibility concept
Benjamin Otte [Tue, 10 Feb 2015 01:50:57 +0000 (02:50 +0100)]
cssnode: Add visibility concept

This allows hiding nodes of invisible widgets.
And that in turn makes sure :nth-child() works as expected.

11 years agobox: Use CSS nodes instead of widget paths
Benjamin Otte [Mon, 9 Feb 2015 21:51:28 +0000 (22:51 +0100)]
box: Use CSS nodes instead of widget paths

This is a very simple patch that causes a bunch of overhead. But it
works.